﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Core.Utilities;
using VOL.Entity;
using VOL.Entity.DomainModels;
using VOL.Smartmanufacturing.Infrastructure;
using VOL.Smartmanufacturing.IServices.WatchedPlatform;

namespace VOL.Smartmanufacturing.Services.WatchedPlatform
{
    public class WatchedPlatformService : IWatchedPlatformService
    {
        /// <summary>
        /// 工单台账仓储
        /// </summary>
        private readonly IBaseRepository<TicketsLedger> _TicketsLedgerRepository;
        private readonly IBaseRepository<Maintenance> _MaintenanceRepository;
        private readonly IBaseRepository<Team> _TeambaseRepository;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="TicketsLedgerRepository">工单台账仓储</param>
        public WatchedPlatformService(IBaseRepository<TicketsLedger> TicketsLedgerRepository,
            IBaseRepository<Maintenance> MaintenanceRepository,
            IBaseRepository<Team> teambaseRepository)
        {
            _TicketsLedgerRepository = TicketsLedgerRepository;
            _MaintenanceRepository = MaintenanceRepository;
            _TeambaseRepository = teambaseRepository;
        }
        /// <summary>
        /// 获取工单台账列表
        /// </summary>
        /// <param name="tcketsLedger">工单台账</param>
        /// <returns>返回任务</returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<WebResponseContent> GetTicketsLedger()
        {
            var result = _TicketsLedgerRepository.GetAll();
            var webResponseContent = WebResponseContent.Instance.OK("显示成功", result);
            return webResponseContent;
        }
        /// <summary>
        /// 获取生产维护列表
        /// </summary>
        /// <returns>返回任务</returns>
        public async Task<WebResponseContent> GetMaintenance()
        {
            var result = _MaintenanceRepository.GetAll();
            var webResponseContent = WebResponseContent.Instance.OK("显示成功", result);
            return webResponseContent;
        }
        /// <summary>
        /// 获取班组列表
        /// </summary>
        /// <returns>返回任务</returns>
        public async Task<WebResponseContent> GetTeamQuery()
        {
            var result = _TeambaseRepository.GetAll();
            var webResponseContent = WebResponseContent.Instance.OK("显示成功", result);
            return webResponseContent;
        }
    }
}
